-
Notifications
You must be signed in to change notification settings - Fork 29
Add nonlinear thin dipole fringe field map #1158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Add nonlinear thin dipole fringe field map #1158
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Merge development into this PR branch.
for more information, see https://pre-commit.ci
Add some additional details to documentation.
for more information, see https://pre-commit.ci
Add additional documentation details.
for more information, see https://pre-commit.ci
|
The three failing tests are due to the Dashboard, and appear to be unrelated to this PR. |
Probably worth vectorizing now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
I added formatting fixes (applying them now), small code suggestions (leaving for your review) and a final suggestion for he user-facing API that I can help with.
| int m_model; //! model specification | ||
| Location m_flag; //! +1 for entry, or -1 for exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a final update, I would like to make m_model and m_flag AMREX_ENUM as we do for SpaceChargeAlgo.
The reason is that I would like users to write in their input files / scripts a descriptive string or type instead of integers that one has to look up.
What would be good string values for each of those?
I assume:
- model: "linear", "order6" ?
- location: "entry", "exit"
Also would call m_flag simply m_location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree m_location works well, with entry and exit as string values. For m_model, I would just use linear and nonlinear. The question of "order" is subtle here, and unrelated to the values of K0-K6 above (which is where I assume the number 6 originated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that "flag" (which can be renamed "location") is already specified here by a user-provided string (not an integer) with values "entry" and "exit" using enum in lines 47-51 of DipEdge.H. Can you clarify the advantage of changing this to an implementation similar to SpaceChargeAlgo (e.g., lines 21-26 of Algorithms.H)?
Co-authored-by: Axel Huebl <[email protected]>
This PR modifies the existing linear DipEdge element to support the nonlinear map of:
K. Hwang and S. Y. Lee, "Dipole fringe field map for compact synchrotrons," Phys. Rev. Accel. Beams 18, 122401 (2015)
The map is expressed in the explicit, symplectic form provided in:
C. Mitchell and K. Hwang, "Explicit symplectic representations of nonlinear dipole fringe field maps," in Proc. NAPAC2025, TUP040, Sacramento, CA, 2025.